<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>回访登记</title>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css" />
<%@ include file="/commons/dateTime.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<script type="text/javascript">
	function openSelectDep(){
		//window.showModalDialog('../join/aux_owner_xr.htm',window,'dialogWidth:700px;dialogHeight:530px;help:no;status:no;scroll:no;certer');
	}
	function submitForm(){ //提交表单
		var flag = $("returnVistitForm").fireEvent("onsubmit");
		if(!flag) return;
		setButtonStatus(false);
		$("mySubmit").click();
	}
	function setButtonStatus(status){ //设置按钮得状态,  status=true  设置可用,否则设置不可用
		$("btn1_12").disabled = !status;
		$("btn1_32").disabled = !status;
	}
/***************选择人*****************/
	function openSelectPerson(){ //打开选人的界面
	  	var url = "${ctx}/common_employeeQuery.do?method=initSelectPsrsonMain";
	  	url += "&frameName=returnVisitAddFrame";
	  	url += "&callBack=setPersonInfo";
	  	url += "&multiple=false";
		top.windowOpen(url, "selectPerson", "选人", 530, 700,true,"selectPerson");
	}
	function setPersonInfo(info){ //设置选人信息
		var personInfos = info.split(";");
		for(var i = 0; i < personInfos.length; i++){
			var temp = personInfos[i].split(",");
			$("recorder").value=temp[1];
		}
	}
/*******************************/
</script>
</head>

<body>
<iframe id="showReslt" name="showResult" style="display:none" onload="setButtonStatus(true);"></iframe>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" class="window_head_outBg">
    	<table border="0" cellpadding="0" cellspacing="0">
	      <tr>
	        <td>
	        	<span class="window_head_intext">
	        		<img src="${ctx}/images/ico_Advance.gif" align="absmiddle" /> 回访登记
	        	</span>
	        </td>
	      </tr>
    	</table>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_2"></td>
  </tr>
  <tr>
  	<form id="returnVistitForm" method="post" class="required-validate" target="showResult"
  		  action="${ctx}/customerService_returnVisitAction.do?method=addQuestionair" >
  		  <input id="mySubmit" type="submit" style="display:none">
  		  <input id="customerServiceEventID" name="customerServiceEventID" type="hidden" value="${custServiceEventVO.keyword }">
    <td colspan="2" class="content">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color">
		<div  style="height:410px;overflow:auto;">
		<table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
          <tr>
			<td class="aux_intable_td1">回访方式：</td>
            <td class="aux_intable_td2">
   				<pms:unitedSelect name="returnVisitWayID"
							style="width:110px;"
							dataList="${returnVisitWayList}"
							optionLabel="name"
							optionValue="keyword"
							selectText="请选择...">
   				</pms:unitedSelect>
			</td>
            <td width="5%" class="aux_intable_td1">联系人：</td>
            <td width="10%" class="aux_intable_td2">
            	${custServiceEventVO.contact}
            	<input type="hidden" name="client" value="${custServiceEventVO.contact}">
            </td>
          </tr>
          <tr>
            <td class="aux_intable_td1">房 号：</td>
            <td class="aux_intable_td2">
            	${custServiceEventVO.houseNumber}
            	<input type="hidden" name="houseNumber" value="${custServiceEventVO.houseNumber}">
            	<input type="hidden" name="houseID" value="${custServiceEventVO.houseKeyword}">
            </td>
            <td class="aux_intable_td1">详细地点：</td>
            <td class="aux_intable_td2">
            	${custServiceEventVO.fullAddress}
            	<input type="hidden" name="fullAddress" value="${custServiceEventVO.fullAddress}">
            </td>
          </tr>
          <tr>
              <td class="aux_intable_td1">回访人：</td>
              <td class="aux_intable_require">
	              <table border="0" cellspacing="0" cellpadding="0">
	                <tr>
	                  <td>
	                  	<input id="recorder" name="recorder" type="text" size="16" maxlength="36" value=""
	                  		   class="inputtext required validate-char"
	                  		   afterInsert="errorShow1" readonly="readonly" />
	                  </td>
	                  <td width="4">&nbsp;</td>
	                  <td>
	                  	<a href="#"  onClick="openSelectPerson();"onFocus="this.blur()">
	                  		<img src="${ctx}/images/ico_cz.gif" width="16" height="16" border="0" />
	                  	</a>
	                  	<span id="errorShow1"></span>
	                  </td>
	                </tr>
	              </table>
              </td>
              <td class="aux_intable_td1">回访日期：</td>
              <td class="aux_intable_require">
              	<table border="0" cellspacing="0" cellpadding="0">
	                <tr>
	                  <td>
	                  	<input name="recordTime" type="text" value="" size="16" maxlength="12"
	                  		class="inputtext required validate-char validate-date"
	                  		afterInsert="errorShow2" /></td>
	                  <td width="4">&nbsp;</td>
	                  <td>
	                  	<img id="imgButtonRecordTime" src="${ctx}/images/ico_date.gif" width="20" height="20" />
	                  	<span id="errorShow2"></span>
	                  </td>
	                </tr>
              	</table>
              </td>
          </tr>
		  <tr>
            <td valign="top" class="aux_intable_td1">回访情况概述：</td>
            <td colspan="3" class="aux_intable_td2">
              <textarea name="summarize" cols="42" rows="3" class="textareatext max-length-100"></textarea>
            </td>
          </tr>
          <tr>
            <td colspan="4" class="aux_titletable">回访内容</td>
          </tr>
          <c:forEach items="${returnVisitItemList}" var="returnVisitItem">
          	<tr>
          		<td valign="top" class="aux_intable_td1">
          			${returnVisitItem.name}：
          			<input type="hidden" name="returnVisitItemID" value="${returnVisitItem.keyword}">
          		</td>
          		<td colspan="3" valign="top" class="aux_intable_td2">
	          		<label>
		              <input name="${returnVisitItem.keyword}_answer" type="radio" value="A"
		              		onclick="document.getElementById('${returnVisitItem.keyword}_remark').disabled=false"/>是&nbsp;　&nbsp;　&nbsp;　&nbsp;
		              <input name="${returnVisitItem.keyword}_answer" type="radio" value="B"
		              		onclick="document.getElementById('${returnVisitItem.keyword}_remark').disabled=false"/>否
		             </label>
	            </td>
          	</tr>
	          <tr>
	            <td valign="top" class="aux_intable_td1">备 注：</td>
	            <td colspan="3" class="aux_intable_td2">
	              <textarea id="${returnVisitItem.keyword}_remark" name="${returnVisitItem.keyword}_remark" cols="42" rows="3" class="textareatext max-length-100" disabled="disabled"></textarea>
				</td>
	          </tr>
          </c:forEach>
        </table>
		</div></td>
      </tr>
    </table></td>
    </form>
  </tr>
  <tr>

    <td class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="buttonOffLeft" id="btn1_11"></td>
            <td class="buttonOffMiddle" id="btn1_12"
            	onClick="submitForm();"
            	onMouseOver="btn_change_over(1)"
            	onMouseOut="btn_change_out(1)"
            	onBlur="btn_change(1)">
            	<img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom" />保 存</td>
            <td class="buttonOffRight" id="btn1_13"></td>
          </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32"
              			onClick="windowClose();"
              			onMouseOver="btn_change_over(3)"
              			onMouseOut="btn_change_out(3)"
              			onBlur="btn_change(3)">
              			<img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" />关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <p>&nbsp;</p></td>
  </tr>
</table>
<script type="text/javascript">
              Calendar.setup(
              {
	              inputField : "recordTime", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "imgButtonRecordTime", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
</script>
</body>
</html>